<?php
namespace app\index\controller;

use think\Controller;
use think\Db;
use think\Cache;

class Info extends Controller
{

	public function index(){
	    echo 'info';exit;
        $link = Db::name('link')->select();
        $this->assign('link',$link);
        $cat = Db::name('cat')->select();
        $tui = Db::name('info')->where('tui',1)->limit(10)->select();
        $ad = Db::name('info')->where('ad',1)->limit(10)->select();
        $info = Db::name('info')
            ->alias('a')
            ->join('cat c','a.catid = c.cat')
            ->order('ding desc')->select();
        $this->assign('cat',$cat);
        $this->assign('tui',$tui);
        $this->assign('ad',$ad);
        $this->assign('info',$info);
		return $this->fetch();
	}

	public function job(){
		$info = Db::name('info')->where('catid',1)->find();
		$this->assign('h',$info);
		return $this->fetch();
	}

	public function info(){
		$info = Db::name('info')->where('id',input('id'))->find();
		$this->assign('h',$info);
        $ding = Db::name('info')->order('ding desc')->limit(20)->select();
		$this->assign('h',$info);
		$this->assign('ding',$ding);
		return $this->fetch();
	}


	public function header(){
        $c = Db::name('config')->where('id',1)->find();
        $this->assign('c',$c);
        return $this->fetch();
    }
}